# Copyright (c) 2022 Robert Bosch GmbH and Microsoft Corporation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0

# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

import vehicle_model.proto.hvac_pb2 as hvac__pb2


class HvacStub(object):
    """*
    @brief Example HVAC service for controlling the heating, ventilation, and air
    conditioning elements of the vehicle cabin.
    This definition is designed here according to the draft of the comfort seats
    service definition of the COVESA Vehicle Service Catalog (VSC) (see
    https://github.com/COVESA/vehicle_service_catalog) as a definition of an
    HVAC service is currently missing in VSC.
    """

    def __init__(self, channel):
        """Constructor.

        Args:
            channel: A grpc.Channel.
        """
        self.SetAcStatus = channel.unary_unary(
                '/sdv.edge.comfort.hvac.v1.Hvac/SetAcStatus',
                request_serializer=hvac__pb2.SetAcStatusRequest.SerializeToString,
                response_deserializer=hvac__pb2.SetAcStatusReply.FromString,
                )
        self.SetTemperature = channel.unary_unary(
                '/sdv.edge.comfort.hvac.v1.Hvac/SetTemperature',
                request_serializer=hvac__pb2.SetTemperatureRequest.SerializeToString,
                response_deserializer=hvac__pb2.SetTemperatureReply.FromString,
                )


class HvacServicer(object):
    """*
    @brief Example HVAC service for controlling the heating, ventilation, and air
    conditioning elements of the vehicle cabin.
    This definition is designed here according to the draft of the comfort seats
    service definition of the COVESA Vehicle Service Catalog (VSC) (see
    https://github.com/COVESA/vehicle_service_catalog) as a definition of an
    HVAC service is currently missing in VSC.
    """

    def SetAcStatus(self, request, context):
        """* Set the desired ac status

        Returns gRPC status codes:
        * OK - AcStatus set
        * OUT_OF_RANGE - The addressed status is not present in this vehicle
        * INVALID_ARGUMENT - At least one of the requested component positions is invalid
        * INTERNAL - A HVAC service internal error happened - see error message for details
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')

    def SetTemperature(self, request, context):
        """* Set the desired cabin temparature

        Returns gRPC status codes:
        * OK - Desired temperature set
        * OUT_OF_RANGE - The addressed temperature is not present in this vehicle
        * NOT_FOUND - The addressed temperature component is not supported by this seat/vehicle
        * INVALID_ARGUMENT - At least one of the requested component positions is invalid
        * INTERNAL - A seat service internal error happened - see error message for details
        """
        context.set_code(grpc.StatusCode.UNIMPLEMENTED)
        context.set_details('Method not implemented!')
        raise NotImplementedError('Method not implemented!')


def add_HvacServicer_to_server(servicer, server):
    rpc_method_handlers = {
            'SetAcStatus': grpc.unary_unary_rpc_method_handler(
                    servicer.SetAcStatus,
                    request_deserializer=hvac__pb2.SetAcStatusRequest.FromString,
                    response_serializer=hvac__pb2.SetAcStatusReply.SerializeToString,
            ),
            'SetTemperature': grpc.unary_unary_rpc_method_handler(
                    servicer.SetTemperature,
                    request_deserializer=hvac__pb2.SetTemperatureRequest.FromString,
                    response_serializer=hvac__pb2.SetTemperatureReply.SerializeToString,
            ),
    }
    generic_handler = grpc.method_handlers_generic_handler(
            'sdv.edge.comfort.hvac.v1.Hvac', rpc_method_handlers)
    server.add_generic_rpc_handlers((generic_handler,))


 # This class is part of an EXPERIMENTAL API.
class Hvac(object):
    """*
    @brief Example HVAC service for controlling the heating, ventilation, and air
    conditioning elements of the vehicle cabin.
    This definition is designed here according to the draft of the comfort seats
    service definition of the COVESA Vehicle Service Catalog (VSC) (see
    https://github.com/COVESA/vehicle_service_catalog) as a definition of an
    HVAC service is currently missing in VSC.
    """

    @staticmethod
    def SetAcStatus(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/sdv.edge.comfort.hvac.v1.Hvac/SetAcStatus',
            hvac__pb2.SetAcStatusRequest.SerializeToString,
            hvac__pb2.SetAcStatusReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

    @staticmethod
    def SetTemperature(request,
            target,
            options=(),
            channel_credentials=None,
            call_credentials=None,
            insecure=False,
            compression=None,
            wait_for_ready=None,
            timeout=None,
            metadata=None):
        return grpc.experimental.unary_unary(request, target, '/sdv.edge.comfort.hvac.v1.Hvac/SetTemperature',
            hvac__pb2.SetTemperatureRequest.SerializeToString,
            hvac__pb2.SetTemperatureReply.FromString,
            options, channel_credentials,
            insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
